<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['base_path']?>public/css/style.css" media="screen" />
        <link rel="shortcut_icon" href="<?php echo $GLOBALS['base_path']?>public/img/icon.ico" />
        <link rel="icon" href="<?php echo $GLOBALS['base_path']?>public/img/icon.png" />
        <title>Foto</title>
        <script type="text/javascript" src="<?php echo $GLOBALS['base_path']?>public/js/fquery.js"></script>
        <script type="text/javascript">
            function init() {
                var elements = getElementsByClassName("pagination", null , null);
                for (var i in elements) {
                    elements[i].onclick = function() {
                        ajaxGet(this.getAttribute('href') , function(result) {
                            //alert(result);
                            document.getElementById('messageList').innerHTML = result;
                        });
                        return false;
                    }
                }
            }
        </script>
    </head>
    <body onload="init()">
        <div id="bodyWrapper">
            <?php $this->render('accountbar');?>
            <div class="dummy"></div>
            <?php $this->render('menubar');?>

            <div id="content">
                <h2>Thread : <?php echo $message->subject ?></h2>
                <div id="messageList">
                <?php foreach($bodies as $body) :?>
                    <?php $user = $body->getSender();?>
                    <div class="myWallCommentPhoto"><img src="<?php if($user->getProfilePicture() != NULL) echo $user->getProfilePicture()->getUrl();?>" alt="" /></div>
                    <div class="myWallCommentPoster"><a href="<?php echo $this->createUrl('profile/view/' . $user->id);?>"> <?php echo $user->fullname;?></a></div>
                    <div class="myWallCommentContent"><?php echo $body->body;?></div>
                <?php endforeach;?>
                </div>
                <?php $pagin->render();?>
                <div id="user_involved">
                    In this message : <br />
                    <?php foreach($message->getUserInvolved() as $key => $user) :?>
                        <div><a href="<?php echo $this->createUrl('profile/view/' . $user->id);?>"><?php echo $user->fullname;?></a></div>
                    <?php endforeach;?>
                </div>

                <h2>Reply to this thread</h2>
                <div id="replyForm">
                    <form method="post" action="">
                        <div class="dtable">
                            <div class="drow">
                                <span class="shead"><label for="body">Body</label></span>
                                <span>
                                    <textarea name="body" id="body" rows="5" cols="40"></textarea>
                                </span>
                            </div>
                            <div class="drow">
                                <span class="shead"></span>
                                <span><input type="submit" name="submit" value="Kirim" /></span>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
                
        </div>
    </body>
</html>